package com.ikingtech.framework.sdk.log.api;

import com.ikingtech.framework.sdk.core.response.R;
import com.ikingtech.framework.sdk.log.model.*;
import com.ikingtech.framework.sdk.log.model.rpc.AuthLogReportParam;
import com.ikingtech.framework.sdk.log.model.rpc.OperationLogReportParam;
import com.ikingtech.framework.sdk.log.model.rpc.SystemLogBatchReportParam;
import com.ikingtech.framework.sdk.web.annotation.PostRequest;
import com.ikingtech.framework.sdk.log.model.*;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author tie yan
 */
public interface LogApi {

    /**
     * 新增登录日志
     *
     * @param authLog 登录日志信息
     * @return 执行结果
     */
    @PostMapping(value = "/auth/report")
    R<Object> reportAuthLog(@RequestBody AuthLogReportParam authLog);

    /**
     * 删除登录日志
     *
     * @param authLogId 登录日志编号
     * @return 执行结果
     */
    @PostMapping(value = "/auth/delete")
    R<Object> deleteAuthLog(@RequestBody String authLogId);

    /**
     * 查询登录日志(分页)
     *
     * @param queryParam 查询参数
     * @return 登录日志列表(分页)
     */
    @PostRequest(order = 1, value = "/auth/list/page", summary = "查询登录日志(分页)", description = "查询登录日志(分页)。")
    R<List<AuthLogDTO>> authLogPage(@Parameter(name = "queryParam", description = "登录日志信息查询参数，包含分页参数、排序参数、查询条件。")
                                    @RequestBody AuthLogQueryParamDTO queryParam);

    @PostRequest(order = 1, value = "/auth/list/conditions", summary = "查询登录日志", description = "查询登录日志。")
    R<List<AuthLogDTO>> listAuthLogByConditions(@Parameter(name = "queryParam", description = "登录日志信息查询参数，包含分页参数、排序参数、查询条件。")
                                                @RequestBody AuthLogQueryParamDTO queryParam);

    /**
     * 新增操作日志
     *
     * @param operationLog 操作日志信息
     * @return 执行结果
     */
    @PostMapping(value = "/operation/report")
    R<Object> reportOperationLog(@RequestBody OperationLogReportParam operationLog);

    /**
     * 删除操作日志
     *
     * @param operationLogId 操作日志编号
     * @return 执行结果
     */
    @PostMapping(value = "/operation/delete")
    R<Object> deleteOperationLog(@RequestBody String operationLogId);

    /**
     * 查询操作日志(分页)
     *
     * @param queryParam 查询参数
     * @return 操作日志列表(分页)
     */
    @PostRequest(order = 2, value = "/operation/list/page", summary = "查询操作日志(分页)", description = "查询操作日志(分页)。")
    R<List<OperationLogDTO>> operationLogPage(@Parameter(name = "queryParam", description = "操作日志信息查询参数，包含分页参数、排序参数、查询条件。")
                                              @RequestBody OperationLogQueryParamDTO queryParam);

    @PostRequest(order = 1, value = "/operation/list/conditions", summary = "查询操作日志", description = "查询操作日志。")
    R<List<OperationLogDTO>> listOperationLogByConditions(@Parameter(name = "queryParam", description = "操作日志信息查询参数，包含分页参数、排序参数、查询条件。")
                                                          @RequestBody OperationLogQueryParamDTO queryParam);

    /**
     * 查询操作日志(日志编号)
     *
     * @param operationLogId 操作日志编号
     * @return 操作日志
     */
    @PostRequest(order = 3, value = "/operation/detail/id", summary = "查询操作日志(日志编号)", description = "查询操作日志(日志编号)")
    R<OperationLogDTO> operationLogDetail(@Parameter(name = "operationLogId", description = "操作日志编号")
                                          @RequestBody String operationLogId);

    /**
     * 新增系统日志
     *
     * @param systemLogs 系统日志信息
     * @return 执行结果
     */
    @PostMapping(value = "/system/report")
    R<Object> reportSystemLog(@RequestBody SystemLogBatchReportParam systemLogs);


    /**
     * 删除系统日志
     *
     * @param systemLogId 系统日志编号
     * @return 执行结果
     */
    @PostMapping(value = "/system/delete")
    R<Object> deleteSystemLog(@RequestBody String systemLogId);

    /**
     * 查询系统日志(分页)
     *
     * @param queryParam 查询参数
     * @return 系统日志列表(分页)
     */
    @PostRequest(order = 4, value = "/system/list/page", summary = "查询系统日志(分页)", description = "查询系统日志(分页)。")
    R<List<SystemLogDTO>> systemLogPage(@Parameter(name = "queryParam", description = "系统日志信息查询参数，包含分页参数、排序参数、查询条件。")
                                        @RequestBody SystemLogQueryParamDTO queryParam);

    /**
     * 查询系统日志(日志编号)
     *
     * @param systemLogId 系统日志编号
     * @return 系统日志
     */
    @PostRequest(order = 5, value = "/system/detail/id", summary = "查询系统日志(日志编号)", description = "查询系统日志(日志编号)")
    R<SystemLogDTO> systemLogDetail(@Parameter(name = "systemLogId", description = "系统日志编号")
                                    @RequestBody String systemLogId);
}
